class RequisitoFormativo < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  has_and_belongs_to_many :mansioni, :join_table => 'mansioni_requisiti_formativi', :uniq => true
  has_many :requisiti_formativi_personale, :class_name => 'RequisitoFormativoPersonale', :dependent => :protect
  has_many :eventi_formativi, :class_name => 'EventoFormativo', :dependent => :protect
  has_many :allegati, :as => :allegato_ref, :dependent => :destroy
  validates_presence_of :name
  validates_uniqueness_of :name, :scope => :deleted_at, :case_sensitive => false
end
